package com.cat.dataStructure03;

import java.util.Arrays;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/contest/weekly-contest-476/problems/maximize-expression-of-three-elements/
 * @create 2025/11/16 10:30
 * @since JDK17
 */

public class Solution66 {
    public int maximizeExpressionOfThree(int[] nums) {
        Arrays.sort(nums);
        int n = nums.length;
        return nums[n - 1] + nums[n - 2] - nums[0];
    }
}
